// InviteTransaction.h: interface for the CInviteTransaction class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_INVITETRANSACTION_H__AE5AC454_5418_4AA1_AFA0_A1860D7B7984__INCLUDED_)
#define AFX_INVITETRANSACTION_H__AE5AC454_5418_4AA1_AFA0_A1860D7B7984__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#pragma warning(disable:4530)
#include "Transaction.h"

class CInviteTransaction : public CTransaction  
{
public:
	typedef enum{
		Ready,
		Calling,
		Proceeding,
		Completed,
		Confirmed,
		Terminated,
	}TSStateMachine;
	void AddRequestMessage(CSIPMessage *pmsg);
	void SendRequest(CSIPMessage &msg);
	void SendResponse(CSIPMessage &msg);
	void Process();
    void AfterSendMsg(int stateMachine_Next);
    void AddRecvMessage(CSIPMessage *pmsg);
	BOOL IsTerminated(){return m_StateMachine == Terminated;};
	CInviteTransaction(const char *pti,CSIPStack *pstack,bool client);
	virtual ~CInviteTransaction();
private:
	TSStateMachine		m_StateMachine;
	uint32				m_nTimerA;
	uint32				m_nTimerB;
	uint32				m_nTimerD;
	uint32				m_nTimerG;
	uint32				m_nTimerH;
	uint32				m_nTimerI;

    CLock               m_respMsgLocker;//yb added 20100301
};

#endif // !defined(AFX_INVITETRANSACTION_H__AE5AC454_5418_4AA1_AFA0_A1860D7B7984__INCLUDED_)
